import HttpUtil from '@/common/HttpUtil'

const ResourceManageApi = {
  saveResourceManage (params) {
    let url = process.env.SURVEY_DOMAIN + '/gr/resourceManage/save'
    return HttpUtil.postJSON(url, params)
  },
  findResourceManagePage (params) {
    let url = process.env.SURVEY_DOMAIN + '/gr/resourceManage/findPage'
    return HttpUtil.postJSON(url, params)
  },
  getResourceManageInfo (param) {
    let url = process.env.SURVEY_DOMAIN + '/gr/resourceManage/getInfo/' + param
    return HttpUtil.get(url, null)
  },
  getModule (param) {
    let url = process.env.SURVEY_DOMAIN + '/gr/resourceManage/getModule/' + param
    return HttpUtil.get(url, null)
  },
  getChildren (param) {
    let url = process.env.SURVEY_DOMAIN + '/gr/resourceManage/getChildren/' + param
    return HttpUtil.get(url, null)
  },
  getTree (param) {
    let url = process.env.SURVEY_DOMAIN + '/gr/resourceManage/getTree'
    return HttpUtil.postJSON(url, {modules: param})
  },
  findList() {
    let url = process.env.SURVEY_DOMAIN + '/gr/resourceManage/findList'
    return HttpUtil.post(url, null)
  },
  remove(id) {
    let url = process.env.SURVEY_DOMAIN + '/gr/resourceManage/delete/'+ id
    return HttpUtil.delete(url, null)
  }
}
export default ResourceManageApi
